package cn.lzy.demo;

import org.springframework.context.ApplicationEvent;

/**
 * @Description 事件定义（方式一）
 * @Author lzy
 * @Date 2024/1/12 1:18
 * @Version
 **/
public class MyEvent extends ApplicationEvent {

    private String name;
    private String gender;

    /**
     *
     * @param source 这个参数是事件的源，即这个事件是由谁来发起的
     */
    public MyEvent(Object source) {
        super(source);
    }


    @Override
    public String toString() {
        return "MyEvent{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
